{extend name="admin@index_layout"/}
{block name="main"}
<form class="layui-form" method="post">
    <input type="hidden" name="id" value="{$data.id}" />
    <div class="layui-form-item">
        <label class="layui-form-label">分类名称</label>
        <div class="layui-input-block">
            <input type="text" value="{$data.name}" name="name" lay-verify="required" autocomplete="off" placeholder="分类名称" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">分类排序</label>
        <div class="layui-input-block">
            <input type="text" value="{$data.sort}" name="sort" lay-verify="required|number" autocomplete="off" placeholder="分类排序" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">主图：</label>
        <!--        <label class="layui-form-label layui-form-item-required">主图</label>-->
        <div class="layui-input-block">
            <input value="{$data.img}" type="text" lay-verify="required" name="img" id="c-pic" value="" class="layui-input">
        </div>
        <div class="layui-input-block">
            <button type="button" class="layui-btn faupload" id="faupload-pic" data-multiple="false"
                    data-input-id="c-pic"
                    data-preview-id="p-pic" data-type="image"><i class="layui-icon layui-icon-upload"></i> 上传
            </button>
            <button type="button" class="layui-btn fachoose" data-multiple="false" data-mimetype="image"
                    data-input-id="c-pic" id="fachoose-c-pic"><i class="iconfont icon-other"></i> 选择
            </button>
            <ul class="layui-row list-inline plupload-preview" id="p-pic"></ul>
        </div>
    </div>
    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit>立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
{/block}
{block name="script"}
<script type="text/javascript">
layui.use(['yznForm','laydate'], function() {
    var yznForm = layui.yznForm,
        laydate = layui.laydate;

    yznForm.bindevent($("form.layui-form"));

    laydate.render({
        elem: '#ID-laydate'
    });

});
</script>
{/block}